home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-17 | 5.5 KB | 266 lines | [TEXT/ALFA] |
- ;=============TeX/LaTeX macros =================================
- ; This file implements some macros that I have found useful with
- ; LaTeX.
- ; David A. Wright
- ; (D.A.Wright@cs.utas.edu.au)
- ; Oct 17, 1991
- ; Please feel free to modify this file to suit your own purposes,
- ; but do please share any improvements with me!
- ; DISCLAIMER: I make no guarantee about the correctness of these
- ; macros. They work for me under Alpha 4.0b2.
- ;===============================================================
-
- ;===============================================================
- ; The following provide an easy way to type Greek and math in
- ; LaTeX.
- (define alpha
- type "\\alpha")
- (define beta
- type "\\beta")
- (define delta
- type "\\delta")
- (define epsilon
- type "\\epsilon")
- (define phi
- type "\\phi")
- (define gamma
- type "\\gamma")
- (define eta
- type "\\eta")
- (define kappa
- type "\\kappa")
- (define lambda
- type "\\lambda")
- (define mu
- type "\\mu")
- (define nu
- type "\\nu")
- (define omega
- type "\\omega")
- (define pi
- type "\\pi")
- (define theta
- type "\\theta")
- (define rho
- type "\\rho")
- (define sigma
- type "\\sigma")
- (define tau
- type "\\tau")
- (define upsilon
- type "\\upsilon")
- (define chi
- type "\\chi")
- (define psi
- type "\\psi")
- (define zeta
- type "\\zeta")
- (define Delta
- type "\\Delta")
- (define Gamma
- type "\\Gamma")
- (define Theta
- type "\\Theta")
- (define Lambda
- type "\\Lambda")
- (define Psi
- type "\\Psi")
- (define Pi
- type "\\Pi")
- (define Sigma
- type "\\Sigma")
- (define Upsilon
- type "\\Upsilon")
- (define Phi
- type "\\Phi")
- (define Omega
- type "\\Omega")
- (define leq
- type "\\leq")
- (define geq
- type "\\geq")
- (define tilde
- type "\\tilde")
- (define infty
- type "\\infty")
- (define forall
- type "\\forall")
- (define exists
- type "\\exists")
- (define not
- type "\\not")
- (define in
- type "\\in")
- (define times
- type "\\times")
- (define subset
- type "\\subset")
- (define supset
- type "\\supset")
- (define subseteq
- type "\\subseteq")
- (define supseteq
- type "\\supseteq")
- (define setminus
- type "\\setminus")
- (define cup
- type "\\cup")
- (define cap
- type "\\cap")
- (define langle
- type "\\langle")
- (define rangle
- type "\\rangle")
- (define hat
- type "\\hat")
- (define vee
- type "\\vee")
- (define emptyset
- type "\\emptyset")
- (define cdot
- type "\\cdot")
-
- (bind 'a' <o> alpha)
- (bind 'b' <o> beta)
- (bind 'd' <o> delta)
- (bind 'e' <o> epsilon)
- (bind 'f' <o> phi)
- (bind 'g' <o> gamma)
- (bind 'h' <o> eta)
- (bind 'k' <o> kappa)
- (bind 'l' <o> lambda)
- (bind 'm' <o> mu)
- (bind '\2d' <o> nu)
- (bind 'o' <o> omega)
- (bind 'p' <o> pi)
- (bind 'q' <o> theta)
- (bind 'r' <o> rho)
- (bind 's' <o> sigma)
- (bind 't' <o> tau)
- (bind 'u' <o> upsilon)
- (bind 'x' <o> chi)
- (bind 'y' <o> psi)
- (bind 'z' <o> zeta)
- (bind '\02' <so> Delta)
- (bind '\05' <so> Gamma)
- (bind '\11' <so> Theta)
- (bind '\25' <so> Lambda)
- (bind '\10' <so> Psi)
- (bind '\23' <so> Pi)
- (bind '\01' <so> Sigma)
- (bind '\20' <so> Upsilon)
- (bind '\09' <so> Phi)
- (bind '\1f' <so> Omega)
- (bind ',' <o> leq)
- (bind '.' <o> geq)
- (bind '~' <o> tilde)
- (bind 'I' <o> infty)
- (bind 'A' <o> forall)
- (bind 'E' <o> exists)
- (bind '!' <o> not)
- (bind 'i' <o> in)
- (bind '*' <o> times)
- (bind '{' <o> subset)
- (bind '}' <o> supset)
- (bind '[' <o> subseteq)
- (bind ']' <o> supseteq)
- (bind '/' <o> setminus)
- (bind '+' <o> cup)
- (bind '-' <o> cap)
- (bind '(' <o> langle)
- (bind ')' <o> rangle)
- (bind '^' <o> hat)
- (bind 'v' <o> vee)
- (bind '0' <o> emptyset)
- (bind '.' <o> cdot)
-
- ;================================================================
- ; Misc. useful macros.
-
- (define timeStamp
- mark "current"
- beginningOfBuffer
- killLine
- type "%% Last entered at "
- acmd "Paste Time"
- type " on "
- acmd "Paste Date"
- goto "current"
- )
-
- (define texComment
- set prefixString "%% "
- insertPrefix)
-
- (define texUncomment
- set prefixString "%% "
- removePrefix)
-
- (define texScopeRegion
- markHilite
- type "{"
- exchangePointAndMark
- type "}"
- exchangePointAndMark)
-
- (define texMathRegion
- markHilite
- type "$"
- exchangePointAndMark
- type "$"
- exchangePointAndMark)
-
- (define texInsertBraces
- type "{}"
- backwardChar)
-
- (define texStartMath
- type "$$"
- backwardChar)
-
- (define texCloseLaTeXBlock
- beginningOfLine
- forwardWord
- forwardChar
- setMark
- forwardWord
- copy
- endOfLine
- 2 carriageReturn
- type "\\end{"
- paste
- type "}"
- previousLine
- doTab)
-
- (define nextSection
- saveVars
- set regExpr on
- set forward on
- forwardChar
- search "\\(sub)?section"
- setMark
- endOfLine
- markHilite
- restoreVars)
-
- (define prevSection
- saveVars
- set regExpr on
- set forward off
- setMark ; unhilites text if currently hilited
- backwardChar
- search "\\(sub)?section"
- setMark
- endOfLine
- markHilite
- restoreVars)
-
- (bind '\15' <s> texStartMath)
- (bind 'w' <o> texCloseLaTeXBlock)
- (bind '{' <s> texInsertBraces)
-
- (bind '\79' nextSection)
- (bind '\74' prevSection)
-
-